<template>
    <div>
        home
        <button @click="clickButton">111</button>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                key: 'yeyang'
            }
        },
        methods:{
            clickButton(){
                const { $store } = this
                console.log($store.state.username)
                $store.commit('upState', this.key)
                console.log($store.state.username)
            }
        }
    }
</script>

<style  scoped>

</style>